package com.rockfalldefence.sw.embark.client.page;

import net.binarymuse.gwt.client.ui.wizard.WizardPage;

import com.google.gwt.user.client.ui.FlowPanel;
import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.HasHorizontalAlignment;
import com.google.gwt.user.client.ui.HorizontalPanel;
import com.google.gwt.user.client.ui.Image;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.TextBox;
import com.google.gwt.user.client.ui.ValueBoxBase.TextAlignment;
import com.google.gwt.user.client.ui.VerticalPanel;
import com.google.gwt.user.client.ui.Widget;
import com.rockfalldefence.sw.embark.client.RDEmbarkContext;

public class VerificaScavalcamentoPage extends WizardPage<RDEmbarkContext> {
	public static final PageID PAGEID = new PageID();
	private FlowPanel panel;
	private Label lbDiametro;
	
	
	
	@Override
	public void beforeShow() {
		super.beforeShow();

		lbDiametro.setText("Diametro blocco =" + getContext().getPhit() +" m");
	}


	public VerificaScavalcamentoPage() {
		panel = new FlowPanel();
	    panel.add(new HTML("<h1>Verifica scavalcamento</h1><br/>"));
	    HorizontalPanel hp = new HorizontalPanel();
	    Image img = new Image("images/trapezio_scavalcamento.png");
	    hp.add(img);
	    VerticalPanel vp = new VerticalPanel();
	    vp.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
	    vp.add(new HTML("<h2 align='center'>Altezza residua κ > diametro blocco Φ</h2>"));
	    Label lb = new Label();
	    lb.setText("Diametro blocco = m");
	    lbDiametro = lb;
	    vp.add( lbDiametro);
	    img = new Image("images/blocco.png");
	    vp.add( img);
	    lb = new Label();
	    lb.setText("κ = 2.3 m");
	    vp.add( lb);
	    TextBox txb = new TextBox();
	    txb.setAlignment(TextAlignment.CENTER);
	    txb.setText("VERIFICATO");
	    txb.setReadOnly(true);
	    vp.add(txb);
	    hp.add(vp);
	    panel.add(hp);  
	}


	@Override
	public Widget asWidget() {
		
		return panel;
	}

	@Override
	public PageID getPageID() {
		return PAGEID;
	}

	@Override
	public String getTitle() {
		return "Scavalcamento";
	}

}
